﻿<Window x:Class="QuizzUI.QuizzContainer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:quizz="clr-namespace:QuizzUI.Quizz"
        Title="QuizzContainer" Height="450" Width="400" 
        WindowStartupLocation="CenterScreen"
        Icon="/QuizzUI;component/Images/datashow.png" KeyDown="Window_KeyDown">
	<Window.Resources>
		<Storyboard x:Key="ScoreScrollUp">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="fxLblScore">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-76">
					<EasingDoubleKeyFrame.EasingFunction>
						<ExponentialEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="fxLblScore">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<ExponentialEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource ScoreScrollUp}"/>
		</EventTrigger>
	</Window.Triggers>
    <Grid>
        <Grid Background="#efefef" Name="grdGame" IsEnabled="False">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <DockPanel Grid.Row="0">
                <Menu>
                    <MenuItem Header="Main Menu" />
                    <MenuItem Header="Edit Question" />
                    <MenuItem Header="Exit" Name="miExit" Click="miExit_Click" />
                </Menu>
            </DockPanel>
            <Grid Name="grdContent" Grid.Row="1" >
                <quizz:FreeResponse Margin="5" x:Name="ctrlQuizz" />
            </Grid>
            <Grid Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" Name="lblTime" FontWeight="DemiBold" FontSize="16" Content="Time Elapsed: " />
                <Label Grid.Column="1" Name="lblScore" FontWeight="DemiBold" FontSize="16"  Content="Score: 0" />
            </Grid>
            <Grid Grid.Row="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="1" HorizontalAlignment="Right" Margin="3">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image Source="/QuizzUI;component/Images/Spheres_Icons_Shiny_Things.png" Grid.Column="0"
                                   MaxHeight="20"/>
                        <Label Content="Submit" Grid.Column="1" />
                    </Grid>
                </Button>
                <Button Grid.Column="0" HorizontalAlignment="Left" Margin="3" Name="lblShowAnswer" Click="lblShowAnswer_Click">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image Source="/QuizzUI;component/Images/Key.png" Grid.Column="0"
                                   MaxHeight="20"/>
                        <Label Content="Show _Answer" Grid.Column="1" />
                    </Grid>
                </Button>
            </Grid>

            <Grid Grid.RowSpan="2" Grid.Row="1" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
            <Label Name="fxLblScore" Content="+0" VerticalAlignment="Bottom" Grid.Column="1" FontWeight="Bold"
                   FontSize="20" Foreground="Green" Margin="35,0,0,0" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
            	<Label.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</Label.RenderTransform>
                </Label>
            </Grid>
        </Grid>
        <Border Width="320" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center"
                CornerRadius="10" Opacity="1" Name="premessage">
            <Border.Background>
                <LinearGradientBrush Opacity=".50">
                    <GradientStop Offset="0" Color="#afafaf" />
                    <GradientStop Offset="1" Color="#efefef" />
                </LinearGradientBrush>
            </Border.Background>
            <Border.Effect>
                <DropShadowEffect BlurRadius="5" />
            </Border.Effect>
            <Label Content="Press Enter to Begin..." HorizontalAlignment="Center" VerticalAlignment="Center"
                   FontSize="25" Name="lblMsg"  />
        </Border>
    </Grid>
</Window>
